package structural.facade;

/**
 * @Author: 蔡翔
 * @Date: 2019/12/9 9:33
 * @Version 1.0
 */
public class GiftExchangeService {
    private QualifyService qualifyService = new QualifyService();
    private PointsPaymentService pointsPaymentService = new PointsPaymentService();
    private ShippingService shippingService = new ShippingService();

    public void giftExchange(PointGift pointGift){
        //资格校验
        if(qualifyService.isAvaliable(pointGift)){
            //字符检验
            if(pointsPaymentService.pay(pointGift)){
                String shippingOrderNum = shippingService.shipGift(pointGift);
                System.out.println("物流下单成功，订单号是："+shippingOrderNum);
            }
        }
    }
}
